package gdou.gym.dao;

import gdou.gym.entity.Eqment;
import gdou.gym.entity.EqmentExample;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface EqmentMapper {
    long countByExample(EqmentExample example);

    int deleteByExample(EqmentExample example);

    int deleteByPrimaryKey(String no);

    int insert(Eqment record);

    int insertSelective(Eqment record);

    List<Eqment> selectByExample(EqmentExample example);

    Eqment selectByPrimaryKey(String no);

    int updateByExampleSelective(@Param("record") Eqment record, @Param("example") EqmentExample example);

    int updateByExample(@Param("record") Eqment record, @Param("example") EqmentExample example);

    int updateByPrimaryKeySelective(Eqment record);

    int updateByPrimaryKey(Eqment record);

    @Update("UPDATE eqment set remain= remain-#{delta} WHERE `no`=#{no} AND remain>=#{delta}")
    int updateRemainByPrimaryKey(@Param("no") String no, @Param("delta") Integer sub);

}